/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sinaEx;

import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import weibo4j.Weibo;
import weibo4j.model.WeiboException;

/**
 *
 * @author Administrator
 */
public class dataExpoter {

    public static void main(String[] args) throws IOException, WeiboException, SQLException, InterruptedException {
        prepareWeibo();        
        dataCollector data = new dataCollector();
    }

    public static void prepareWeibo() {
        String accessToken = spider.Auth4Code.getCode();
        Weibo weibo = new Weibo();
        weibo.setToken(accessToken);
    }

    public static void parepareMySQL() throws SQLException {
        try {
            Class.forName("com.mysql.jdbc.Driver").newInstance();
            Connection conn = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/weibonews", "root", "");
            Statement stmt = (Statement) conn.createStatement();
            stmt.executeUpdate("INSERT INTO `weibonews`.`wb_ex_network` (`uid`, `username`, `friendsCount`, `fansCount`, `verified`, `interestTag`, `mediaCount`, `agencyCount`, `celebrityCount`, `normalCount`, `websiteCount`, `brandCount`, `campusCount`, `blogFrequency`) VALUES (122323, '2323', 2323, 2323, 23, '2323', 22, 33, 232, 323, 2, 23, 23, 23);");
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("connect error");
        }

    }
}
